home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-SPAR.{_A / EBUS.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  3KB  |  97 lines

  1. /* $Id: ebus.h,v 1.8 1998/05/07 21:00:27 ecd Exp $
  2.  * ebus.h: PCI to Ebus pseudo driver software state.
  3.  *
  4.  * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
  5.  */
  6.  
  7. #ifndef __SPARC64_EBUS_H
  8. #define __SPARC64_EBUS_H
  9.  
  10. #include <asm/oplib.h>
  11.  
  12. struct linux_ebus_child {
  13.     struct linux_ebus_child        *next;
  14.     struct linux_ebus_device    *parent;
  15.     struct linux_ebus        *bus;
  16.     int                 prom_node;
  17.     char                 prom_name[64];
  18.     unsigned long             base_address[PROMREG_MAX];
  19.     int                 num_addrs;
  20.     unsigned int             irqs[PROMINTR_MAX];
  21.     int                 num_irqs;
  22. };
  23.  
  24. struct linux_ebus_device {
  25.     struct linux_ebus_device    *next;
  26.     struct linux_ebus_child        *children;
  27.     struct linux_ebus        *bus;
  28.     int                 prom_node;
  29.     char                 prom_name[64];
  30.     unsigned long             base_address[PROMREG_MAX];
  31.     int                 num_addrs;
  32.     unsigned int             irqs[PROMINTR_MAX];
  33.     int                 num_irqs;
  34. };
  35.  
  36. struct linux_ebus {
  37.     struct linux_ebus        *next;
  38.     struct linux_ebus_device    *devices;
  39.     struct linux_pbm_info        *parent;
  40.     struct pci_dev            *self;
  41.     int                 prom_node;
  42.     char                 prom_name[64];
  43.     struct linux_prom_ebus_ranges     ebus_ranges[PROMREG_MAX];
  44.     int                 num_ebus_ranges;
  45.     struct linux_prom_ebus_intmap     ebus_intmap[PROMREG_MAX];
  46.     int                 num_ebus_intmap;
  47.     struct linux_prom_ebus_intmask     ebus_intmask;
  48. };
  49.  
  50. struct linux_ebus_dma {
  51.     unsigned int dcsr;
  52.     unsigned int dacr;
  53.     unsigned int dbcr;
  54. };
  55.  
  56. #define EBUS_DCSR_INT_PEND    0x00000001
  57. #define EBUS_DCSR_ERR_PEND    0x00000002
  58. #define EBUS_DCSR_DRAIN        0x00000004
  59. #define EBUS_DCSR_INT_EN    0x00000010
  60. #define EBUS_DCSR_RESET        0x00000080
  61. #define EBUS_DCSR_WRITE        0x00000100
  62. #define EBUS_DCSR_EN_DMA    0x00000200
  63. #define EBUS_DCSR_CYC_PEND    0x00000400
  64. #define EBUS_DCSR_DIAG_RD_DONE    0x00000800
  65. #define EBUS_DCSR_DIAG_WR_DONE    0x00001000
  66. #define EBUS_DCSR_EN_CNT    0x00002000
  67. #define EBUS_DCSR_TC        0x00004000
  68. #define EBUS_DCSR_DIS_CSR_DRN    0x00010000
  69. #define EBUS_DCSR_BURST_SZ_MASK    0x000c0000
  70. #define EBUS_DCSR_BURST_SZ_1    0x00080000
  71. #define EBUS_DCSR_BURST_SZ_4    0x00000000
  72. #define EBUS_DCSR_BURST_SZ_8    0x00040000
  73. #define EBUS_DCSR_BURST_SZ_16    0x000c0000
  74. #define EBUS_DCSR_DIAG_EN    0x00100000
  75. #define EBUS_DCSR_DIS_ERR_PEND    0x00400000
  76. #define EBUS_DCSR_TCI_DIS    0x00800000
  77. #define EBUS_DCSR_EN_NEXT    0x01000000
  78. #define EBUS_DCSR_DMA_ON    0x02000000
  79. #define EBUS_DCSR_A_LOADED    0x04000000
  80. #define EBUS_DCSR_NA_LOADED    0x08000000
  81. #define EBUS_DCSR_DEV_ID_MASK    0xf0000000
  82.  
  83. extern struct linux_ebus        *ebus_chain;
  84.  
  85. extern void ebus_init(void);
  86.  
  87. #define for_each_ebus(bus)                        \
  88.         for((bus) = ebus_chain; (bus); (bus) = (bus)->next)
  89.  
  90. #define for_each_ebusdev(dev, bus)                    \
  91.         for((dev) = (bus)->devices; (dev); (dev) = (dev)->next)
  92.  
  93. #define for_each_edevchild(dev, child)                    \
  94.         for((child) = (dev)->children; (child); (child) = (child)->next)
  95.  
  96. #endif /* !(__SPARC64_EBUS_H) */
  97.